package com.zhiyun;

import java.util.Random;

public class StudentNo {

	private final static String SCHOOL_CODE = "E";
	private final static String GRADE = "17";
	private final static int RANDOM_LENGTH = 4;

	public static void main(String[] args) {
		String randomStr = getRandomString(RANDOM_LENGTH);
		System.out.println(SCHOOL_CODE + GRADE + randomStr);
	}

	private static int getRandom(int count) {
		return (int) Math.round(Math.random() * count);
	}

	private static String string = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";

	private static String getRandomString(int length) {
		StringBuffer sb = new StringBuffer();
		int len = string.length();
		for (int i = 0; i < length; i++) {
			sb.append(string.charAt(getRandom(len - 1)));
		}
		return sb.toString();
	}
}
